package net.servir.censo.web.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import net.servir.censo.model.CapValidacion;
import net.servir.censo.model.Censo;
import net.servir.censo.service.CensoService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class SalirController {

	@Autowired
	private CensoService censoService;
	@RequestMapping("/salir.htm")
	public @ModelAttribute("censo")
	CapValidacion censo(HttpServletRequest request,
			HttpServletResponse response) {
		CapValidacion obj = new CapValidacion();
		HttpSession session = request.getSession();
		String cod_session =session.getId();
		request.setAttribute("acceso", "RESP");
		session.setAttribute("id_sistema", null);
		session.setAttribute("id_ambito", null);
		session.setAttribute("dni", null);
		session.setAttribute("mensaje", "");
		session.setAttribute("num_intentos", null);
		try {
			response.sendRedirect("inicio.htm");
		} catch (Exception e) {
//			obj.setMensaje_usuario(e.getMessage());
		}
		return obj;
	}
}
